package Week_01;

import java.io.IOException;
import java.io.PrintWriter;

import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

public class OldStyleServlet extends HttpServlet{
	@Override
	protected void doGet(HttpServletRequest req, HttpServletResponse resp)
			throws ServletException, IOException {
		String age= req.getParameter("age");
		String city = req.getParameter("city");
		// ctrl + shift + o
		PrintWriter pw= resp.getWriter();
		pw.write("I'm Old Style servlet");
		if(Integer.parseInt(age) < 20) {
			pw.write("you are child");
		} else {
			pw.write("you are adult");
		}
		pw.write("you live in " + city );
		pw.close();
		
	}
	
}
